package com.wanxi.faceobject.template.test2;
//private成员变最name, id, birthday,其中birthday为MyDate 类的对象;
//必要的构造器;
//abstract方法earnings(),返回工资数额;
//toString()方法输出对象的name , number和birthday.|
public abstract class Employee {

    private String name;
    private int id;
    private MyDate birthday;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public MyDate getBirthday() {
        return birthday;
    }

    public void setBirthday(MyDate birthday) {
        this.birthday = birthday;
    }

    public Employee() {
    }

    public Employee(String name, int id, MyDate birthday) {
        this.name = name;
        this.id = id;
        this.birthday = birthday;
    }
    public abstract double earnings();

    @Override
    public String toString() {
        return "Employee{" +
                "name='" + name + '\'' +
                ", id=" + id +
                ", birthday=" + birthday +
                '}';
    }

    public String getInfo(){
        return "姓名: "+ name+",工号: "+id+",出生日期: "+birthday.getMyDate();
    }
}
